<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSitesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sites', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('user_id')->default(0)->index()->comment('关联用户');
            $table->string('name')->comment('网站名称');
            $table->string('url')->comment('网站域名');
            $table->integer('column_id')->default(0)->comment('所属栏目');
            $table->integer('area_id')->default(0)->comment('所属地区');
            $table->string('keywords')->comment('关键词');
            $table->string('description')->comment('网站描述');
            $table->string('icon')->comment('ICO图标');
            $table->text('content')->comment('表单数据');
            $table->integer('views')->default(0)->comment('浏览量');
            $table->integer('is_best')->default(0)->comment('是否推荐');
            $table->integer('is_top')->default(0)->comment('是否置顶');
            $table->integer('is_pay')->default(0)->comment('是否付费');
            $table->integer('state')->default(0)->comment('状态');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sites');
    }
}
